net/dns.c: Fix endian conversion for big-endian in dns command
authorBernhard Kaindl <[email protected]>
Sat, 15 Oct 2011 23:59:22 +0000 (23:59 +0000)
committerWolfgang Denk <[email protected]>
Sun, 23 Oct 2011 21:34:19 +0000 (23:34 +0200)
commit6dc809f40721e5424367b09c8dbfe07da50b8ca9
tree0f5ec2f2eacdb4e3bfdaef96c32edd97e597af15
parentf5ca20c6b60acfce81f45a0a0a92a5e72de5b008
net/dns.c: Fix endian conversion for big-endian in dns command

net/dns.c used endian conversion macros wrongly (shorts in reply
were put swapped into CPU, and then ntohs() was used to swap it
back, which broke on big-endian).

Fix this by using the correct linux conversion macro for reading
a unaligned short in network byte order: get_unaligned_be16()
Thanks to Mike Frysinger pointing at the best macro to use.

Tested on big and little endian qemu boards (mips and versatile)

Signed-off-by: Bernhard Kaindl <[email protected]>
Cc: Pieter Voorthuijsen <[email protected]>
Cc: Robin Getz <[email protected]>
Acked-by: Mike Frysinger <[email protected]>
net/dns.c